//
//  SPDocUploadModel.h
//  
//
//  Created by SPSuper on 2017/7/12.
//  Copyright © 2017年 etonedu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BGFMDB.h"
#import "WLSocketWorker.h"
typedef NS_ENUM(NSInteger, SPFileType) {
    SPFileTypeVideo = 1,
    SPFileTypePhoto,
    SPFileTypeMusic
};

typedef NS_ENUM(NSInteger, FileLoadingState) {
    FileLoadingStateWaiting = 1,
    FileLoadingStateRunning,
    FileLoadingStatePause,
    FileLoadingStateComplete,
    FileLoadingStateDeleted,
    FileLoadingStateFail
};
typedef NS_ENUM(NSInteger, WLDataBaseModelType) {
    WLDataBaseModelTypeUpload,
    WLDataBaseModelTypeUploaded,
    WLDataBaseModelTypeDownload,
    WLDataBaseModelTypeDownloaded
};
@interface WLFileUpDownLoadModel : NSObject
@property (nonatomic, assign) BOOL showInCompleteList;
@property (nonatomic, assign)  SPFileType fileType;
/** 图片数据，视频使用fileURL */
@property (nonatomic, strong) NSData *fileData;
// 上传状态标识, 记录是上传中还是暂停
@property (nonatomic, assign) FileLoadingState loadState;
// 缓存文件路径 URL.Path的路径
@property (nonatomic, copy) NSString *filePath;
// 缓存文件URL
@property (nonatomic, copy) NSURL *fileURL;
// 用来保存文件名使用
@property (nonatomic, copy) NSString *fileName;
@property (nonatomic, assign) float process;
//@property (nonatomic, strong) NSProgress *process;

@property (nonatomic, assign) BOOL isUpLoad;

@property (nonatomic, strong) NSString *fileTotalSize;
@property (nonatomic, assign) unsigned long long fileTotalBytes;
@property (nonatomic, assign) unsigned long long sendedTotalBytes;
@property (nonatomic, assign) unsigned long long tempBytes;
@property (nonatomic, copy) NSString *comleteTime;


@property (nonatomic, strong) NSString *requestURL;
/** 视频或照片在本地相册的标识通过该标识找到PHAsset对象获取相应的信息 */
@property (nonatomic, strong) NSString *localIdentifier;
/** 视频或照片在本地相册的标识通过该标识找到PHAsset对象获取相应的信息 */
@property (nonatomic, strong) NSURL *mediaLocalURL;
// 方便操作(暂停取消)正在上传的文件
@property (nonatomic, strong) WLSocketWorker *dataTask;

@property (nonatomic, assign) BOOL saveToAbulm;

/***********************************************/

@property (nonatomic, assign) NSInteger totalCount;
@property (nonatomic, assign) int64_t totalSize;
@property (nonatomic, assign) NSInteger uploadedCount;
@property (nonatomic, copy) NSString *upToken;
- (WLFileRequest *)getRequestModel;
- (WLFileRequest *)getRequestModelNotSave;

+ (NSString *)getTableNameWithModelType:(WLDataBaseModelType)modelType;
@end


